#include"com_test.h"

        
int main() 
{
    int fds[2], len = 0;
    char buff[256];
    
    if (pipe(fds) == -1) perror("make pipe faile"), exit(0);

    //read from stdin
    while (fgets(buff, 100, stdin)) 
    {
	len = strlen(buff);

	//write to pipe
	
       int n = write(fds[1], buff, len);
       if (n == -1) perror("write faile");

       memset(buff, 0, sizeof(buff));

       //read from pipe
       read(fds[0], buff, len);
       
       write(1, buff, len);
     }
       return 0;
}


	
